﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace server.app.lib
{
    public class Map1 : Space
    {
        public static Dictionary<string, comm.lib.ObjEVDefine> GetObjEVDefineDic(comm.lib.ObjEVType evType)
        {
            var dic = new Dictionary<string, comm.lib.ObjEVDefine>();
            return dic;
        }

        public Map1(World world, string mapId, string starId, string spaceId, int threadIndex, Dictionary<string, comm.objst.DMap.Data.Obj> exObjDic = null)
            : base(world, mapId, starId, spaceId, threadIndex, exObjDic)
        {
        }

        protected override void OnObjectEnter(Object[] enterObjs, Player player)
        {
            if (player != null)
            {
                player.Send(comm.objst.TcpMessageType.ToClientCreateSpace, new string[] { MapId, StarId, SpaceId });
                player.Send(comm.objst.TcpMessageType.ToClientSpaceFillObject, GetAllObject().ToObjstSObjectArray());
            }

            GetAllPlayer(player).Send(comm.objst.TcpMessageType.ToClientSpaceObjectEnter, enterObjs.ToObjstSObjectArray());
        }
        protected override void OnObjectLeave(Object[] leaveObjs, Player player)
        {
            GetAllPlayer(player).Send(comm.objst.TcpMessageType.ToClientSpaceObjectLeave, leaveObjs.ToObjectIdArray());
        }
    }
}
